#ifndef _DFA_H_
#define _DFA_H_

#include "input_data.h"

struct dfa{
  int size; // Capacity (in vertices)
  int total; // Number of vertices in the dfa
  int words_num; // Number of words in the trie
  int alph_size; // Size of the alphabet
  int * edges; // Array with edges, contains (size * alph_size) elements
  dfa (int _size, int _alph_size);
  virtual ~dfa();

  int* operator[] (int v); // Returns the pointer to the edge list of vertex v

  const bool add_word(const char * word); // Returns false if dfa is full
  const bool bad_suffix_trie(const char * buff, const int len, const char dir) const; // Checks if some suffix of the word in buff is forbidden
};

dfa * create_dfa(const input_data & INPUT, int size);

#endif
